﻿CREATE TABLE [dbo].[UserAccounts]
(
	[UserId]		[BIGINT]	NOT NULL,
	[AccountId]		[BIGINT]	NOT NULL,
	[CreatedAt]		[DATETIME]	NOT NULL,
	CONSTRAINT PK_UserAccounts PRIMARY KEY ([UserId], [AccountId]),
	CONSTRAINT FK_UserAccounts_Users FOREIGN KEY ([UserId]) REFERENCES [dbo].[Users]([Id]),
	CONSTRAINT FK_UserAccounts_Accounts FOREIGN KEY ([AccountId]) REFERENCES [dbo].[Accounts]([Id])
)
